<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS 比较</title>
    <script>
        /*
        *   == 等于
        *   === 值 和 类型 全等
        *   !=
        *   >
        *   >=
        *   <
        *   <=
        *   逻辑运算符
        *   &&
        *   ||
        *    !
        *
        *    条件云算符
        *    var iable = (condition) ? value1:value2
        *    var greeting = (visitor == "PRES") ? "Dear President" : "Dear "
        * */

        function testCondition() {

            var visitor = "PRES"
            var greeting = (visitor == "PRES") ? "Dear President" : "Dear "
            alert(greeting)
        }

    </script>
</head>
<body>
    <button onclick="testCondition()">测试条件云算符</button><br/>
</body>
</html>